package com.msb.简单树;


/**
 * @author whf
 * @date 2024-12-18 15:13
 * https://leetcode.com/problems/maximum-depth-of-binary-tree/
 */
public class TreeMaxDepth_easy {
    
    // 记住递归(结束条件, 递归, 具体操作)
    // 比大小熟练运用Math函数
    public int maxDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }
        return Math.max(maxDepth(root.left), maxDepth(root.right)) + 1;
    }
}
